package com.kedll.library.mvp;

import android.databinding.BaseObservable;
import android.view.View;

import com.kedll.library.BR;
import com.kedll.library.adapter.MultiTypeAdapter;


/**
 * Created by baurine on 1/10/17.
 */

public abstract class BaseItem<T> extends BaseObservable implements MultiTypeAdapter.IItem<T> {

    private T data;
    ////////////////////////////////////////////
    // handle event
    private View.OnClickListener onClickListener;
    private View.OnLongClickListener onLongClickListener;

    public BaseItem(T data) {
        this.data = data;
    }

    @Override
    public int getVariableId() {
        return BR.item;
    }

    @Override
    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public View.OnClickListener getOnClickListener() {
        return onClickListener;
    }

    public void setOnClickListener(View.OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
    }

    public View.OnLongClickListener getOnLongClickListener() {
        return onLongClickListener;
    }

    public void setOnLongClickListener(View.OnLongClickListener onLongClickListener) {
        this.onLongClickListener = onLongClickListener;
    }
}
